﻿using FluentValidation.Attributes;
using Nop.Admin.Models.Common;
using Nop.Admin.Validators.XJ;
using Nop.Core.Domain.XJ;
using Nop.Web.Framework;
using Nop.Web.Framework.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Nop.Admin.Models.XJ
{
	public class InspectionListModel
	{
		public InspectionListModel()
		{
			AvailableAims = new List<SelectListItem>();
			AvailableCategorys = new List<SelectListItem>();
			AvailablePlaces = new List<SelectListItem>();
			AvailableTypes = new List<SelectListItem>();
			AvailableDepartments = new List<SelectMenuModel>();
			AvailableUsers = new List<SelectListItem>();
			AvailableStates = new List<SelectListItem>();
		}
		public int SearchTypeId { get; set; }
		[UIHint("SelectMenu")]
		public int SearchDepartId { get; set; }
		/// <summary>
		/// 巡检目标
		/// </summary>
		public int SearchAimId { get; set; }
		[UIHint("SelectMenu")]
		public int SearchCategoryId { get; set; }
		/// <summary>
		/// 巡检点
		/// </summary>
		[UIHint("SelectMenu")]
		public int SearchPlaceId { get; set; }
		/// <summary>
		/// 巡检班组
		/// </summary>
		[UIHint("SelectMenu")]
		public int SearchTeamId { get; set; }
		/// <summary>
		/// 巡检人
		/// </summary>
		public int SearchPersonId { get; set; }
		public int SearchPlanId { get; set; }
		/// <summary>
		/// 计划编号
		/// </summary>
		public string SearchPNo { get; set; }
		public string SearchName { get; set; }
		public int SearchState { get; set; }
		/// <summary>
		/// 巡检目标
		/// </summary>
		public IList<SelectListItem> AvailableAims { get; set; }
		/// <summary>
		/// 设施设备类别
		/// </summary>
		public IList<SelectListItem> AvailableCategorys { get; set; }
		//public IList<SelectMenuModel> AvailableCategorys { get; set; }
		/// <summary>
		/// 巡检点
		/// </summary>
		public IList<SelectListItem> AvailablePlaces { get; set; }
		/// <summary>
		/// 类型
		/// </summary>
		public IList<SelectListItem> AvailableTypes { get; set; }
		/// <summary>
		/// 部门
		/// </summary>
		public IList<SelectMenuModel> AvailableDepartments { get; set; }
		public IList<SelectListItem> AvailableUsers { get; set; }
		public IList<SelectListItem> AvailableStates { get; set; }
	}
	[Validator(typeof(InspectionValidator))]
	public class InspectionModel : BaseNopEntityModel
	{
		public InspectionModel()
		{
			AvailableTypes = new List<SelectListItem>();
			AvailableDepartments = new List<SelectMenuModel>();
			AvailableUsers = new List<SelectListItem>();
			Pictures = new List<string>();
		}
		/// <summary>
		/// 巡检计划Id
		/// </summary>
		public int InspectionPlanId { get; set; }
		/// <summary>
		/// 维修Id
		/// </summary>
		public int MaintenanceId { get; set; }
		/// <summary>
		/// 维修编号
		/// </summary>
		[NopResourceDisplayName("维修编号", true)]
		public string XNo { get; set; }
		/// <summary>
		/// 计划编号
		/// </summary>
		[NopResourceDisplayName("计划编号", true)]
		public string PNo { get; set; }
		/// <summary>
		/// 计划名称
		/// 有名称，巡检内容里显示名称；没有名称，巡检内容显示具体的巡检点、设备分类
		/// </summary>
		[NopResourceDisplayName("计划名称", true)]
		public string Name { get; set; }
		/// <summary>
		/// 类型：日巡检、周巡检、月巡检
		/// <see cref="InspectionTypeEnum"/>
		/// </summary>
		[NopResourceDisplayName("巡检类型", true)]
		public int TypeId { get; set; }
		[NopResourceDisplayName("巡检类型", true)]
		public string TypeName { get; set; }
		public int AimId { get; set; }
		[NopResourceDisplayName("巡检目标", true)]
		public string AimName { get; set; }
		[NopResourceDisplayName("巡检内容", true)]
		public string Content { get; set; }
		/// <summary>
		/// 班组Id
		/// </summary>
		[UIHint("SelectMenu")]
		[NopResourceDisplayName("巡检班组", true)]
		public int TeamId { get; set; }
		[NopResourceDisplayName("巡检班组", true)]
		public string TeamName { get; set; }
		/// <summary>
		/// 人员Id
		/// </summary>
		[NopResourceDisplayName("巡检人员", true)]
		public int PersonId { get; set; }
		[NopResourceDisplayName("巡检人员", true)]
		public string PersonName { get; set; }
		/// <summary>
		/// 巡检备注
		/// </summary>
		[NopResourceDisplayName("巡检备注", true)]
		public string Comment { get; set; }
		/// <summary>
		/// 创建人
		/// </summary>
		[NopResourceDisplayName("巡检人", true)]
		public int CustomerId { get; set; }
		[NopResourceDisplayName("巡检人", true)]
		public string CustomerName { get; set; }
		/// <summary>
		/// 创建时间
		/// </summary>
		[NopResourceDisplayName("巡检日期", true)]
		public DateTime CreatedOn { get; set; }
		/// <summary>
		/// 类型
		/// </summary>
		public IList<SelectListItem> AvailableTypes { get; set; }
		/// <summary>
		/// 部门班组
		/// </summary>
		public IList<SelectMenuModel> AvailableDepartments { get; set; }
		/// <summary>
		/// 人员
		/// </summary>
		public IList<SelectListItem> AvailableUsers { get; set; }
		/// <summary>
		/// 巡检图片
		/// </summary>
		public IList<string> Pictures { get; set; }
	}
}